<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p><input id="username" type="text"></p>
    <p><input id="password" type="text"></p>
    <p><button id="but">注册</button></p>
</body>
<script src="./axios.js"></script>
<script>
    const username = document.getElementById("username")
    const password = document.getElementById("password")
    const but = document.getElementById("but")
    but.addEventListener("click",()=>{
        axios.post("/getGoods",{
            userName:username.value,
            passWord:password.value,
        }).then((res) => {
             if(res.data.code === 0){
                location.href="./login.html"
             }
             console.log(res.data.message)
        })
    })

</script>
</html>